home *** CD-ROM | disk | FTP | other *** search
/ Cre@te Online 2000 December / Cre@teOnline CD05.iso / MacSoft / XML ConsoleMax.sea / XML ConsoleMax / Required / ldapjdk.jar / netscape / ldap / util / RDN.class (.txt) < prev   
Encoding:
Java Class File  |  1999-04-13  |  1.2 KB  |  51 lines

  1. package netscape.ldap.util;
  2.  
  3. public final class RDN {
  4.    String m_type;
  5.    String m_value;
  6.  
  7.    public RDN(String var1) {
  8.       int var2 = var1.indexOf("=");
  9.       if (var2 > 0) {
  10.          this.m_type = var1.substring(0, var2).trim();
  11.          this.m_value = var1.substring(var2 + 1).trim();
  12.       }
  13.    }
  14.  
  15.    public String[] explodeRDN(boolean var1) {
  16.       if (this.m_type == null) {
  17.          return null;
  18.       } else {
  19.          String[] var2 = new String[1];
  20.          if (var1) {
  21.             var2[0] = this.m_value;
  22.          } else {
  23.             var2[0] = this.toString();
  24.          }
  25.  
  26.          return var2;
  27.       }
  28.    }
  29.  
  30.    public String getType() {
  31.       return this.m_type;
  32.    }
  33.  
  34.    public String getValue() {
  35.       return this.m_value;
  36.    }
  37.  
  38.    public String toString() {
  39.       return this.m_type + "=" + this.m_value;
  40.    }
  41.  
  42.    public static boolean isRDN(String var0) {
  43.       RDN var1 = new RDN(var0);
  44.       return var1.m_type != null && var1.m_value != null;
  45.    }
  46.  
  47.    public boolean equals(RDN var1) {
  48.       return this.toString().toUpperCase().equals(var1.toString().toUpperCase());
  49.    }
  50. }
  51.